package main

import (
	"fmt"
	"time"
)

//定义一个channel,用来完成数据同步
var channel = make(chan int)

func printer(s string) {
	for _, ch := range s {
		fmt.Printf("%c\n", ch)
		time.Sleep(time.Second)
	}
}
func persion1() { //先执行
	printer("hello")
	channel <- 8
}
func persion2() { //后执行
	printer("world")
}
func main() {
	go persion1()
	go persion2()
	for {
	}
}
